package com.kuwei.utils;

import java.util.HashMap;
import java.util.Map;

public class ReturnResult
{
    // 执行返回结果内容
    private Object data;
    
	private String status;
    
    private String message;
    
    public String getStatus() {
		return status;
	}

	public void setStatus(String status) {
		this.status = status;
	}

	public String getMessage() {
		return message;
	}

	public void setMessage(String message) {
		this.message = message;
	}
	
	public Object getData() {
		return data;
	}
    
	public void setData(Object data) {
		this.data = data;
	}
	
	public void setContent(String status,String message){
		if(CommonUtils.isNotEmpty(status))
			this.setStatus(status);
		if(CommonUtils.isNotEmpty(message))
			this.setMessage(message);
	}
	
	public void setContent(String status,String message, Object data){
		if(CommonUtils.isNotEmpty(status))
			this.setStatus(status);
		if(CommonUtils.isNotEmpty(message))
			this.setMessage(message);
		if(CommonUtils.isNotEmpty(data))
			this.setData(data);
	}
	
	public Object getContent(){
		Map<String,Object> rtnMap = new HashMap<String, Object>();
		if(CommonUtils.isNotEmpty(this.getStatus()))
			rtnMap.put("status", this.getStatus());
		if(CommonUtils.isNotEmpty(this.getMessage()))
			rtnMap.put("message", this.getMessage());
		if(CommonUtils.isNotEmpty(this.getData()))
			rtnMap.put("content", this.getData());
		
		return rtnMap;
	}
}
